package com.cloud.nacos.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ConsumerTestController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/test/{vo}")
    public String echo(@PathVariable String vo) {
        // http://服务名/路由
        return restTemplate.getForObject("http://provider-nacos/test/" + vo, String.class);
    }
}
